﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WMS.Domain
{
    /// <summary>
    /// 出库单主表
    /// </summary>
    public class OutboundOrder
    {
        /// <summary>
        /// 主键
        /// </summary>
        [Key]
        public int Id { get; set; }
        /// <summary>
        /// 出库单编号
        /// </summary>
        [Required]
        [MaxLength(50)]
        public string OrderNumber { get; set; }

        /// <summary>
        /// 团队
        /// </summary>
        [MaxLength(100)]
        public string Team { get; set; }

        /// <summary>
        /// 仓库ID
        /// </summary>
        public int WarehouseId { get; set; }

        /// <summary>
        /// 仓库名称
        /// </summary>
        [MaxLength(100)]
        public string WarehouseName { get; set; }

        /// <summary>
        /// 参考号
        /// </summary>
        [MaxLength(100)]
        public string ReferenceNumber { get; set; }

        /// <summary>
        /// 出库日期
        /// </summary>
        public DateTime OutboundDate { get; set; }

        /// <summary>
        /// 单据状态 (0:草稿 1:待上传 2:待上传 3:已完成)
        /// </summary>
        public int DocumentStatus { get; set; }

        /// <summary>
        /// 换标附件 (文件上传状态)
        /// </summary>
        public int AttachmentStatus { get; set; }

        /// <summary>
        /// 收件附件 (文件上传状态)
        /// </summary>
        public int RecipientAttachmentStatus { get; set; }

        // 收件人信息
        /// <summary>
        /// 收件人姓名
        /// </summary>
        [Required]
        [MaxLength(100)]
        public string RecipientName { get; set; }

        /// <summary>
        /// 收件人手机
        /// </summary>
        [Required]
        [MaxLength(20)]
        public string RecipientPhone { get; set; }

        /// <summary>
        /// 省份
        /// </summary>
        [MaxLength(50)]
        public string Province { get; set; }

        /// <summary>
        /// 城市
        /// </summary>
        [MaxLength(50)]
        public string City { get; set; }

        /// <summary>
        /// 区县
        /// </summary>
        [MaxLength(50)]
        public string District { get; set; }

        /// <summary>
        /// 详细地址
        /// </summary>
        [MaxLength(500)]
        public string Address { get; set; }

        /// <summary>
        /// 邮编
        /// </summary>
        [MaxLength(10)]
        public string PostalCode { get; set; }

        /// <summary>
        /// 国家
        /// </summary>
        [MaxLength(50)]
        public string Country { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [MaxLength(1000)]
        public string Remark { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreatedTime { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime UpdatedTime { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        [MaxLength(50)]
        public string CreatedBy { get; set; }

        // 导航属性
        /// <summary>
        /// 出库单明细列表
        /// </summary>
        public virtual ICollection<OutboundOrderDetail> OrderDetails { get; set; } = new List<OutboundOrderDetail>();
    }


}
